package cn.iocoder.yudao.module.api.dine.enums;

import cn.iocoder.yudao.framework.business.basic.enums.EnumValuable;
import com.baomidou.mybatisplus.annotation.EnumValue;
import lombok.Getter;
import lombok.RequiredArgsConstructor;

import java.util.Arrays;

/**
 * <pre>
 * OOoO0OOoO0OOOooo0oOOOO0OOOOO0oooOO0ooOOO0Ooooo0OOOOo0ooooO0OOooo0Ooooo0OOOOO
 * 菜品属性枚举
 * OOoO0OOoO0OOOooo0oOOOO0OOOOO0oooOO0ooOOO0Ooooo0OOOOo0ooooO0OOooo0Ooooo0OOOOO
 * </pre>
 *
 * @author 山野羡民（1032694760@qq.com）
 * @since 2025/08/01
 */
@RequiredArgsConstructor
@Getter
public enum DineAttributeEnum implements EnumValuable {
    NONE(0, "无"),
    STAPLE(1, "主食"),
    MEAT(2, "荤菜"),
    VEGETABLE(3, "素菜"),
    SOUP(4, "汤"),
    CONDIMENT(5, "调料"),
    DRINK(6, "饮品"),
    FRUIT(7, "水果"),
    HOTPOT(20, "锅底"),
    COMBO(50, "套餐"),
    KITCHENWARE(98, "餐盒"),
    REMARK(99, "备注"),
    ;

    @EnumValue
    private final Integer value;
    private final String name;

    public static DineAttributeEnum getByValue(Integer value) {
        return Arrays.stream(values())
                .filter(item -> item.getValue().equals(value))
                .findFirst().orElse(NONE);
    }

}
